<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <title>库存查询</title>
</head>

<body>
  <div id="app" v-loading.fullscreen.lock="loading">
    <div class="material-stock">
      <el-tabs v-if="menus!==null" v-model="activeMenu" class="dorm-mgr-tabs full-tabs">
        <el-tab-pane lazy v-for="menu in menus" :key="menu.name" :label="menu.label" :name="menu.name">
          <component :is="menu.url" class="menu-item"></component>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</body>

<script src="../../myJs/importFile.js"></script>
<script>
  importFile([
    "/vueSystem/components/css/sysCommonSearch.css",
    "/vueSystem/components/css/searchBtnView.css",
    "./css/updatePositionForm.css",
    "./css/materialWarehouse.css",
    "./css/orderWarehouse.css"
  ], [
    "/vueSystem/i18n/index.js",
    "/vueSystem/components/sysCommonSearch.js",
    "/vueSystem/components/searchBtnView.js",
    "/vueSystem/mixins/tablePaginationMixin.js"
  ]);
</script>
<script src="./warehouseInfoRecord.js"></script>
<script src="./updatePositionForm.js"></script>
<script src="./orderAvailableCount.js"></script>
<script src="./searchForm.js"></script>
<script src="./productionUnitInfo.js"></script>
<script src="./materialWarehouse.js"></script>
<script src="./orderWarehouse.js"></script>
<script>
  var app = new Vue({
    el: '#app',
    data: function () {
      return {
        loading: false,
        activeMenu: 'materialWarehouse',
        menus: null
      };
    },

    created: function () {
      this.loading = true;
      var self = this;
      return SysUtil.getUser().then(function (user) {
        self.loading = false;
        var isPayUser = user.companyInfo.status === 1;
        var menus = [{
          label: '物料库存查询',
          name: 'materialWarehouse',
          url: 'material-warehouse'
        }];
        if (isPayUser) {
          menus.push({
            label: '订单库存查询',
            name: 'orderWarehouse',
            url: 'order-warehouse'
          });
        }
        self.menus = menus;
      }).catch(function () {
        self.loading = false;
      });
    },

    components: {
      MaterialWarehouse: MaterialWarehouse,
      OrderWarehouse: OrderWarehouse
    }
  });
</script>
<style>
  .material-stock {
    padding-left: 20px;
    height: 100%;
  }
</style>

</html>